import React, {Component, PropTypes} from 'react'
import render from 'react-dom'
import {bindActionCreators} from 'redux'
import TabBar from 'antd-mobile/lib/tab-bar';
import 'antd-mobile/lib/tab-bar/style/index.less';


class commons_index extends Component {
    componentDidMount() {
        this.props.actions.getList({});
    }

    render() {

    }
}

const contextTypes = {
    router: PropTypes.object.isRequired,
    store: PropTypes.object.isRequired
}

commons_index.contextTypes = contextTypes;

function mapStateToProps(state) {
  return {
    action_state: state.commons_index.get('action_state'),
    getResult: state.commons_index.get('getResult')
  }
}
//将action的所有方法绑定到props上
function mapDispatchToProps(dispatch) {
  return {
      actions: bindActionCreators({
          getList,
          delList,
          testAjax
      }, dispatch)
  }
}

//通过react-redux提供的connect方法将我们需要的state中的数据和actions中的方法绑定到props上
export default connect(mapStateToProps, mapDispatchToProps)(commons_index)

